﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace David_Albert
{
    public partial class FormMantAuto : Form
    {
       
        public FormMantAuto()
        {
           
            InitializeComponent();


        }

        private void btnMantAutOK_Click(object sender, EventArgs e)
        {
            try
            {
                BaseDeDades.insertarAutors(this.txtNomAutor.Text, this.txtCognom.Text);
                MessageBox.Show("Autor Afegir correctament", "Informacio", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            catch (Exception n)
            {
                MessageBox.Show("No s'ha pogut guardar l'autor", "Autor", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            this.Close();
           
        }

        private void btnManAutCan_Click(object sender, EventArgs e)
        {
            //if (MessageBoxIcon.Show("Estas segur que vols sortir sense realitzar canvis", "Nou autro", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                this.Close();

        }
    }
}
